<?php 


$title = '联系我们';

$css = 'contact_us';

$data = dbselOne($con,'contact_us','*',1);

$hid = $_GET['hid'];

$banner = dbselect($con,'banner','*',"cate_id='{$hid}' and status = 1",'create_time desc','1');

// var_dump(json_decode($banner[0]['path']));die;

if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
	if(isset($_POST['phone'])){

		$phone = $_POST['phone'];

		$prule = "/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/";

		echo preg_match($prule,$phone);die;

	}else if(isset($_POST['email'])){

		$email = $_POST['email'];

		$erule = "/^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/";	

		echo preg_match($erule,$email);die;

	}else if(isset($_POST['submit'])){


		$data['mess_name'] = $_POST['snickname'];
		$data['content'] = $_POST['scontent'];
		$data['mess_time'] = time();
		$data['phone'] = $_POST['sphone'];
		$data['email'] = $_POST['semail'];
		$verify = md5(strtolower($_POST['sverify']));


		if($_SESSION['mess'] != $verify){
			$list['ver'] = 0 ;
		}else{

			$list['ver'] = 1 ;

			$query = dbinsert($con,'message',$data);

			if($query){
				$list['int'] = 1 ;
			}else{
				$list['int'] = 0 ;
			}
		}

		

		echo json_encode($list);die;
	} 	



}

























require("application/home/views/public/header.html");

include("application/".M."/views/".C."/".V.".html");

require("application/home/views/public/footer.html");


?>